/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "PARTNERS", catalog = "", schema = "SCRATCHCARD")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Partner.findAll", query = "SELECT p FROM Partner p"),
    @NamedQuery(name = "Partner.findByPartnerId", query = "SELECT p FROM Partner p WHERE p.partnerId = :partnerId"),
    @NamedQuery(name = "Partner.findByPassword", query = "SELECT p FROM Partner p WHERE p.password = :password"),
    @NamedQuery(name = "Partner.findBySecretKey", query = "SELECT p FROM Partner p WHERE p.secretKey = :secretKey"),
    @NamedQuery(name = "Partner.findByStatus", query = "SELECT p FROM Partner p WHERE p.status = :status"),
    @NamedQuery(name = "Partner.findByIps", query = "SELECT p FROM Partner p WHERE p.ips = :ips"),
    @NamedQuery(name = "Partner.findByCreatedTime", query = "SELECT p FROM Partner p WHERE p.createdTime = :createdTime"),
    @NamedQuery(name = "Partner.findByLastUpdatedTime", query = "SELECT p FROM Partner p WHERE p.lastUpdatedTime = :lastUpdatedTime"),
    @NamedQuery(name = "Partner.findByCompanyName", query = "SELECT p FROM Partner p WHERE p.companyName = :companyName"),
    @NamedQuery(name = "Partner.findByCompanyAddr", query = "SELECT p FROM Partner p WHERE p.companyAddr = :companyAddr"),
    @NamedQuery(name = "Partner.findByCompanyPhone", query = "SELECT p FROM Partner p WHERE p.companyPhone = :companyPhone")})
public class Partner implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "PARTNER_ID")
    private String partnerId;
    @Size(max = 40)
    @Column(name = "PASSWORD")
    private String password;
    @Size(max = 40)
    @Column(name = "SECRET_KEY")
    private String secretKey;
    @Column(name = "STATUS")
    private Short status;
    @Size(max = 4000)
    @Column(name = "IPS")
    private String ips;
    @Column(name = "CREATED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdTime;
    @Column(name = "LAST_UPDATED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdatedTime;
    @Size(max = 40)
    @Column(name = "COMPANY_NAME")
    private String companyName;
    @Size(max = 100)
    @Column(name = "COMPANY_ADDR")
    private String companyAddr;
    @Size(max = 50)
    @Column(name = "COMPANY_PHONE")
    private String companyPhone;

    public Partner() {
    }

    public Partner(String partnerId) {
        this.partnerId = partnerId;
    }

    public String getPartnerId() {
        return partnerId;
    }

    public void setPartnerId(String partnerId) {
        this.partnerId = partnerId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public Short getStatus() {
        return status;
    }

    public void setStatus(Short status) {
        this.status = status;
    }

    public String getIps() {
        return ips;
    }

    public void setIps(String ips) {
        this.ips = ips;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getLastUpdatedTime() {
        return lastUpdatedTime;
    }

    public void setLastUpdatedTime(Date lastUpdatedTime) {
        this.lastUpdatedTime = lastUpdatedTime;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCompanyAddr() {
        return companyAddr;
    }

    public void setCompanyAddr(String companyAddr) {
        this.companyAddr = companyAddr;
    }

    public String getCompanyPhone() {
        return companyPhone;
    }

    public void setCompanyPhone(String companyPhone) {
        this.companyPhone = companyPhone;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (partnerId != null ? partnerId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Partner)) {
            return false;
        }
        Partner other = (Partner) object;
        if ((this.partnerId == null && other.partnerId != null) || (this.partnerId != null && !this.partnerId.equals(other.partnerId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.Partner[ partnerId=" + partnerId + " ]";
    }
    
}
